#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<string> findWords(vector<string>& words)
    {
        vector<string> ret;
        string Idx = "12210111011122000010020202";
        for (auto& s : words) {
            bool isValid = true;
            char idx = Idx[tolower(s[0]) - 'a'];
            for (int i = 1; i < s.size(); ++i) {
                if (Idx[tolower(s[i]) - 'a'] != idx) {
                    isValid = false;
                    break;
                }
            }
            if (isValid) {
                ret.push_back(s);
            }
        }
        return ret;

    }
};